const express = require('express');
const router = express.Router();
const authController = require('../controllers/auth.controller');
const { authMiddleware } = require('../middlewares/auth.middleware');

// 登录接口
router.post('/login', authController.login);
// 登出接口
router.post('/logout', authMiddleware, authController.logout);
// 刷新token接口
router.post('/refresh-token', authController.refreshToken);

// 请求密码重置
router.post('/password-reset/request', authController.requestPasswordReset);

// 验证重置令牌
router.get('/password-reset/verify/:token', authController.verifyResetToken);

// 重置密码
router.post('/password-reset/:token', authController.resetPassword);

module.exports = router; 